package com.jspx.txweb.interceptor;

import com.jspx.boot.environment.Environment;
import com.jspx.txweb.ActionInvocation;
import com.jspx.txweb.support.ActionSupport;

/**
 * 禁止访问拦截器
 *
 */
public class ProhibitInterceptor extends InterceptorSupport {

    public void init() {

    }

    public void destroy() {

    }


    public String intercept(ActionInvocation actionInvocation)
    {
        //这里是不需要验证的action
        ActionSupport action = actionInvocation.getActionProxy().getAction();
        action.addFieldInfo(Environment.warningInfo,"此页面禁止访问");
          return ActionSupport.UNTITLED;
        //也可以 return Action.ERROR; 终止action的运行
    }
}